<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ShopModel extends Model
{
    use HasFactory;
    use SoftDeletes;
    protected $table='shop';
    protected $primaryKey='shop_id';
    //查询对应商品所在的店铺
    function storeInfo(){
        return $this->hasOne(StoreModel::class,'store_id','shop_name')->select(['store_id','store_name']);
    }
}
